
using System;
using System.Collections;
using System.Web.UI.WebControls;

using Awaken.Framework;
using Nullables;

namespace Northwind.Domain.Entities
{
    public partial class Shipper : IEntity
    {
        protected static ShipperBroker broker;
        public static ShipperBroker Broker
        {
            get
            {
                if (broker == null)
                {
                    broker = new ShipperBroker();
                }
                return broker;
            }
        }

        #region IEntity Members

        public string EntityID
        {
            get { return string.Empty; }
        }
        
        public string EntityName
        {
            get { return string.Empty; }
        }

        public void Save()
        {
            Broker.Save(this);
        }
        
        public void Delete()
        {
            Broker.Delete(this);
        }
        
        #endregion
    
        #region Constructor
        
        public Shipper()
        {
            // Default, no arg constructor.
        }
        
        #endregion
            
        #region Public Properties / Protected Fields
                        
        
        protected System.Int32? _ShipperID;
        public System.Int32? ShipperID
        {
            get{ return _ShipperID; }
            set{ _ShipperID=value; }
        }
        
        protected string _CompanyName;
        public string CompanyName
        {
            get{ return _CompanyName; }
            set{ _CompanyName=value; }
        }
        
        protected string _Phone;
        public string Phone
        {
            get{ return _Phone; }
            set{ _Phone=value; }
        }
        
        
        
        
                
        
        
        
        #endregion
    }
    
    #region ShipperBroker

    public partial class ShipperBroker : IBroker
    {
        #region IBroker Members

        public Type EntityType
        {
            get { return typeof(Shipper); }
        }
        
        public Shipper GetByID(object id)
        {
            return (Shipper)Awaken.Framework.Gateway.GetByID(EntityType, id);
        }

        public IList GetAll()
        {
            return Awaken.Framework.Gateway.GetAll(EntityType);
        }

        public void Save(IEntity entity)
        {
            Awaken.Framework.Gateway.Save(entity);
        }
        
        public void Delete(IEntity entity)
        {
            Awaken.Framework.Gateway.Delete(entity);
        }
        
        #endregion
    }
    #endregion
}
